#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char ** argv) {
	char * url = argv[1];
	char * data_part = strtok(url, "?");
	char *saveptr,*saveptr2, 
		 *str1;
	int i;
	printf("%s\n",data_part);
	data_part = strtok(NULL, "?");
	printf("%s\n",data_part);
	char *pair;
	char *k,*v;
	for (i = 1, str1 = data_part; ; i++,str1 = NULL) {
		pair = strtok_r(str1, "&",&saveptr);
		if (pair == NULL) break;
		k = strtok_r(pair, "=", &saveptr2);
		v = strtok_r(NULL, "=", &saveptr2);
		printf("K:%s;V:%s\n",k,v);
	}
	puts(url);
}
